<#compress>
    <#assign actionname>${(action=='create')?string('新建','编辑')}</#assign>
    <@override name="title">${actionname}商品</@override>
    <@override name="viewbody">
    <div class="row">
        <div class="col-md-12">
            <h3 class="page-title">
            ${actionname}商品
                <small>${actionname}商品.</small>
            </h3>
            <ul class="page-breadcrumb breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="${ctx}/admin/home">
                        首页
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="${ctx}/admin/brand">
                        品牌管理
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="${ctx}/admin/commodity/${commodity.brand!}">
                    商品管理
                    </a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">
                    ${actionname}商品
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading"><h6 class="panel-title">商品信息</h6></div>
        <div class="panel-body">
            <form class="form-horizontal" action="${ctx}/admin/commodity/save" role="form" id="commodityForm" method="post">
                <input name="commodity.id" type="hidden" value="${commodity.id!}"/>
                <input name="commodity.brand" type="hidden" value="${commodity.brand!}"/>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="description">商品描述:</label>

                    <div class="col-sm-10">
                        <textarea rows="5" cols="5" id="description" class="limited form-control input-xlarge"
                                  name="commodity.description"
                                  placeholder="请输入楼层描述">${commodity.desciption!}</textarea>
                    </div>
                </div>

                <div class="form-group">

                    <label class="col-sm-2 control-label" for="pricture"></label>

                    <div class="col-lg-2 col-md-4 col-sm-4">
                        <p class="form-control-static">
                            <input id="commodityAttachmentUpload" type="file" class="btn">
                        </p>
                    </div>
                    <input type="hidden" id="picture" name="commodity.picture" value="${commodity.picture!}">
                </div>

                <div class="form-group" id="show_picture"
                     style="display: ${(commodity.picture??)?string('display','none')};">
                    <label class="col-sm-2 control-label text-right">商品图片:</label>

                    <div class="col-lg-2 col-md-4 col-sm-4">
                        <p class="form-control-static">
                            <a href="<#if commodity.picture??>${ctx}/${commodity.picture}</#if>"
                               class="thumbnail fancybox-button" id="box_picture" data-rel="fancybox-button">
                                <img src="<#if commodity.picture??>${ctx}/${commodity.picture?replace('.','.thumbnail.')}</#if>"
                                     alt=""/>
                            </a></p>
                    </div>
                </div>

                <div class="form-actions text-right">

                    <a class="btn default yellow-stripe" href="${ctx}/admin/commodity/${commodity.brand!}"><i
                            class="fa fa-arrow-circle-o-left"></i> 返回</a>
                    <input type="submit" value="保存" class="btn btn-primary">
                </div>

            </form>
        </div>

    </div>
    </@override>

    <@override name="viewmodule">commodity_item</@override>
    <@extends name="../_basic/main.ftl"></@extends>
</#compress>